package reverse_listnode

import (
)

//ReverseLinkedLList Reverse a single linkedList
func ReverseLinkedLList(list *utils.ListNode) *utils.ListNode {
	if list == nil || list.Next == nil {
		return list
	}
	var head *utils.ListNode
	cur := list
	for cur != nil {
		cur.Next, head, cur = head, cur, cur.Next
	}
	return head
}

